package com.example.schedutest.task;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * @author lzh
 * @date 2019/9/12 - 9:22
 */
@Component
public class CronTask {


    private int count = 0;


    //每隔六秒打印一下内容
    @Scheduled(cron = "*/6 * * * * ?")
    private void process(){
        System.out.println("task running "+(count++));
    }


}
